package com.company.cloud.company.modules.api.service;

import com.company.cloud.common.bean.BaseClientResult;
import com.company.cloud.company.modules.api.fallback.CompanyRemoteServiceFallbackFactory;
import com.company.cloud.company.modules.api.request.*;
import com.company.cloud.company.modules.api.response.*;
import com.company.common.server.constant.ServiceNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;
import java.util.Set;

@FeignClient(contextId = "company", name = ServiceNameConstant.user_center, fallbackFactory = CompanyRemoteServiceFallbackFactory.class)
public interface CompanyRemoteService {

    /**获取公司信息*/
    @RequestMapping(value = "/remote/user/companyById", method = RequestMethod.GET)
    public BaseClientResult<CompanySimple> getCompanySimple(@RequestParam("companyNo") String companyNo);

    /**获取公司信息*/
    @RequestMapping(value = "/remote/user/companyByIds",method = RequestMethod.POST)
    public BaseClientResult<Map<String, CompanySimple>> getCompanyMapSimple(@RequestBody Set<String> companyNos);

    /**获取公司信息*/
    @RequestMapping(value = "/remote/user/companyFullById", method = RequestMethod.GET)
    public BaseClientResult<CompanyFull> getCompanyFull(@RequestParam("companyNo") String companyNo);

    /**获取公司信息*/
    @RequestMapping(value = "/remote/user/companyFullByIds",method = RequestMethod.POST)
    public BaseClientResult<Map<String, CompanyFull>> getCompanyMapFull(@RequestBody Set<String> companyNos);

    /**查询公司信息*/
    @RequestMapping(value = "/remote/user/companyFullQuery",method = RequestMethod.POST)
    public BaseClientResult<CompanyFullPage> queryCompanyFull(@RequestBody CompanyQueryRequest request);


    /**新增公司信息*/
    @RequestMapping(value = "/remote/platform/companyAdd",method = RequestMethod.POST)
    public  BaseClientResult<CompanyFull> addCompany(@RequestBody CompanyAddRequest request);

    /**新增公司信息*/
    @RequestMapping(value = "/remote/platform/company2UserAdd",method = RequestMethod.POST)
    public  BaseClientResult<CompanyFull> addCompany2User(@RequestBody Company2UserAddRequest request);

    /**修改公司信息*/
    @RequestMapping(value = "/remote/platform/companyUpdate",method = RequestMethod.POST)
    public  BaseClientResult<CompanyFull> updateCompany(@RequestBody CompanyUpdateRequest request);

    /**删除公司信息*/
    @RequestMapping(value = "/remote/platform/companyDel",method = RequestMethod.POST)
    public  BaseClientResult<CompanyFull> delCompany(@RequestBody CompanyDelRequest request);


    /**审核公司信息*/
    @RequestMapping(value = "/remote/platform/companyCheck",method = RequestMethod.POST)
    public  BaseClientResult<CompanyFull> checkCompany(@RequestBody CompanyCheckRequest request);


    /**冻结公司信息*/
    @RequestMapping(value = "/remote/platform/companyFrozen",method = RequestMethod.POST)
    public  BaseClientResult<CompanyFull> frozenCompany(@RequestBody CompanyFrozenRequest request);

    /**解冻公司信息*/
    @RequestMapping(value = "/remote/platform/companyUnfreeze",method = RequestMethod.POST)
    public  BaseClientResult<CompanyFull> unfreezeCompany(@RequestBody CompanyUnFreezeRequest request);




}
